import javax.swing.text.html.parser.TagElement;

/*
public class Shit {

    public static void main(String[] args) {
        B bb = new B(12,"666",25,"666");
        bb.Function();
    }
}


class A {
    public A (int age, String name) {
        this.age = age;
        this.name = name;
    }

    public A () {};

    @Override
    public String toString() {
        return "A{" +
                "age=" + age +
                ", name='" + name + '\'' +
                '}';
    }

    public void Function() {
        System.out.println("such a shitty world!!!!");
    }

    private int age;
    private String name;
}

class B extends A {

    public B(int age, String name, int xx, String shit) {
        super(age, name);
        this.xx = xx;
        this.shit = shit;
    }

    public B(){};

    public void Function() {
        super.Function();
    }

    @Override
    public String toString() {
        return "B{" +
                "xx=" + xx +
                ", shit='" + shit + '\'' +
                '}';
    }

    private int xx;
    private String shit;
}

 */

/*
class Animal {

    static {
        System.out.println("Animal static coding area");
    }

    {
        System.out.println("Animal real coding area");
    }
    private int age;
    private String name;
    public void eat() {
        System.out.println(this.name + " is eating");
    }

    public Animal() {
        System.out.println("Animal's constructor with none");
    };

    public Animal(int age, String name) {
        this.age = age;
        this.name = name;
        System.out.println("Animal's constructor with 2");
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}

class Cat extends Animal {
    private String fur;

    static {
        System.out.println("cat static coding area");
    }

    {
        System.out.println("cat real coding area");
    }

    public Cat(int age, String name, String fur) {
        super(age, name);
        this.fur = fur;
        System.out.println("cat's constructor with 3");
    }

    public Cat() {
        super();
        System.out.println("cat's constructor with 0");
    };

    public void mew() {
        System.out.println(super.getName() + " is mewing!!");
    }
}


public class Shit {

    /*public static void main(String[] args) {
        Cat cat1 = new Cat(18,"666","black");
        //cat1.name = "mimi";
        cat1.mew();
        cat1.eat();
    }



    public static void main(String[] args) {
        Cat cat1 = new Cat(16,"666","black");
        System.out.println("******************");
        Cat cat2 = new Cat(16,"666","black");
    }
}

 */

class Animal {
    public String name;
    public int age;

    public void eat() {
        System.out.println("eating!");
    }
}

class Cat extends Animal {
    public String fur;

    @Override
    public void eat() {
        System.out.println("吃猫猫");
    }

    public void mew() {
        System.out.println(this.name + " is mewing");
    }
}

class Dog extends Animal {
    @Override

    public void eat() {
        System.out.println("吃狗粮");
    }
}


public class Shit{
    /*
    public static void main(String[] args) {
        Animal animal = new Cat();
        animal.name = "mimi";
        animal.eat();
    }

     */

    public static void Function(Animal a) {
        a.eat();
    }

    public static void main(String[] args) {
        Cat cat = new Cat();
        Dog dog = new Dog();
        Function(cat);
        Function(dog);
    }
}

